package com.ymatou.iapi.livebuyer.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.livebuyer.service.PublishLiveStatCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymatou.iapi.livebuyer.parameter.*;
/**
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_PublishLiveStat{
	private static PublishLiveStatBean PublishLiveStatBean;
	private static PublishLiveStatCall PublishLiveStatCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("发布直播统计信息");
	}

	@Before
	public void caseUp() {
		PublishLiveStatCall=new PublishLiveStatCall();
		PublishLiveStatBean=new PublishLiveStatBean();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(PublishLiveStatCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_PublishLiveStat_001() {
		Logger.start(true,"全量发布直播统计信息成功");
		try {
			//调用时会更新LiveRoomStat 需要做人数变更可看到效果 这个是全局更新调用 实际场景需要通过登入退出比心看到效果 在对应场景中调用测试到
			PublishLiveStatCall.callService();
			Logger.verifyEquals("ok", PublishLiveStatCall.getReturnData(), "返回ok");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_PublishLiveStat_002() {
		Logger.start(true,"直播发布直播统计信息成功");
		try {
			//调用时会更新LiveRoomStat 需要做人数变更可看到效果 这个是全局更新调用 实际场景需要通过登入退出比心看到效果
			PublishLiveStatBean.setLiveId(100);
			PublishLiveStatCall.setData(PublishLiveStatBean);
			PublishLiveStatCall.callService();
			Logger.verifyEquals("ok", PublishLiveStatCall.getReturnData(), "返回ok");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}